<html>
<head>
    <title>原始值统计</title>
    <link rel="stylesheet" href="../../../assets/bundle.element.css">
    <link rel="stylesheet" href="../../../style.css">

    <style>
        body{
            background: #F2F2F2;
        }


        .main-head{
            background: #fff;
            padding-left: 10px;
            padding-top: 10px;
            margin-bottom: 0px;
            border: solid 1px #fff;
        }

        .chart-outer{
            height: 200px;
        }




    </style>
</head>
<body>
<div class="page" id="page-original">
    <div class="page-title">报表管理 › 原始值统计</div>
    <div class="page-main">
        <el-row>
            <el-col :span="4">
                <dev-tree v-on:click-node="aa" :tabsign="'d'" :zonetype="3"></dev-tree>
            </el-col>
            <el-col :span="20">
                <div class="main-head">
                    <el-form :inline="true">
                        <el-form-item label="">
                            <el-date-picker type="date" v-model="day" value-format="yyyy-MM-dd" placeholder="日期" style="width: 150px;"></el-date-picker>
                        </el-form-item>

                        <el-form-item>
                            <el-tooltip effect="dark" content="请点击左边树中设备" v-model="tooltip" placement="right">
                            <el-button type="primary" @click="search" style="background: #578BBB">查询</el-button>
                            </el-tooltip>
                        </el-form-item>

                    </el-form>
                </div>

                <el-table border stripe style="width: 100%;" :data="originalData" >
                    <el-table-column prop="date" label="时间段"  align="center">
                        <template slot-scope="scope">{{ scope.row.attributes.time1.substring(scope.row.attributes.time1.lastIndexOf("T")+1,scope.row.attributes.time1.length)}}</template>
                    </el-table-column>
                    <el-table-column prop="groupName" label="测量点"  align="center">
                    </el-table-column>
                    <el-table-column  label="负荷"  align="center">
                        <el-table-column prop="field23" label="A相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field24" label="B相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field25" label="C相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field12" label="总"  align="center">

                        </el-table-column>
                    </el-table-column>
                    <el-table-column prop="field01" label="电量"  align="center">
                    </el-table-column>
                    <el-table-column  label="示数"  align="center">
                        <el-table-column prop="field01" label="总有功"  align="center">

                        </el-table-column>
                        <el-table-column prop="field22" label="反向有功"  align="center">

                        </el-table-column>
                    </el-table-column>
                    <el-table-column  label="电压"  align="center">
                        <el-table-column prop="field13" label="A相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field14" label="B相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field15" label="C相"  align="center">

                        </el-table-column>
                    </el-table-column>
                    <el-table-column  label="电流"  align="center">
                        <el-table-column prop="field16" label="A相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field17" label="B相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field18" label="C相"  align="center">

                        </el-table-column>
                    </el-table-column>
                    <el-table-column  label="功率因素"  align="center">
                        <el-table-column prop="field26" label="A相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field27" label="B相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field28" label="C相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field19" label="总"  align="center">

                        </el-table-column>
                    </el-table-column>
                    <el-table-column  label="温度"  align="center">
                        <el-table-column prop="field29" label="A相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field30" label="B相"  align="center">

                        </el-table-column>
                        <el-table-column prop="field31" label="C相"  align="center">

                        </el-table-column>
                    </el-table-column>
                    <el-table-column  label="谐波（畸变率）"  align="center">
                        <el-table-column prop="field35" label="A相电流" align="center">

                        </el-table-column>
                        <el-table-column prop="field32" label="A相电压" align="center">

                        </el-table-column>
                        <el-table-column prop="field36" label="B相电流" align="center">

                        </el-table-column>
                        <el-table-column prop="field33" label="B相电压" align="center">

                        </el-table-column>
                        <el-table-column prop="field37" label="C相电流" align="center">

                        </el-table-column>
                        <el-table-column prop="field34" label="C相电压" align="center">

                        </el-table-column>
                    </el-table-column>
                </el-table>
            </el-col>
        </el-row>
    </div>


</div>



<script type='text/javascript' src='../../../assets/bundle.js' charset='utf-8'></script>
<script type='text/javascript' src='../../../assets/jquery-1.11.2.min.js' charset='utf-8'></script>
<script type='text/javascript' src='../../../assets/echarts.min.js' charset='utf-8'></script>
<script type='text/javascript' src='../../../js/common.js' charset='utf-8'></script>
<script type='text/javascript' src='../../../js/component.js' charset='utf-8'></script>
<script>

    var vuePage=new Vue({
        el:'#page-original',
        data:{
            day:'',
            originalData:[],
            expandId:'',
            currentId:'',
            dataId:'',
            tooltip:false,
        },
        methods:{
            search:function(){
                this.getOriginalData();
            },
            exportBtn:function(){
            },
           aa:function (data) {
               this.currentId = data.id;
               this.dataId  = data.dataId;
               this.getOriginalData();
           },
           getOriginalData(){
                var ids =this.currentId.split('_');
                switch (ids[0]) {
                    case "D":
                        var dArr = this.day.split('-');
                        var param={
                            zoneIds:[this.dataId].join(','),
                            zoneType:3,
                            energyType:'Electric',
                            year:dArr[0]||0,
                            month:dArr[1]||0,
                            day:dArr[2]||0,
                            sumType:0,
                        };
                        HttpUtil.get('Analysis/getEnergyParam', param).success((res)=>{
                                     this.originalData = res.data;
                        });
                        break;
                    default:
                        this.originalData = [];
                        break;
                }
            }
        },
        created:function(){

            this.day = TimeUtil.convertToString(new Date()).substr(0,10);

        },
        mounted:function(){
            this.tooltip = true;
        }
    });


</script>

</body>
</html>
